from config import BASE_DIR
import json


def read():
    from config import BASE_DIR
    with open(BASE_DIR +'/data/data.json',encoding='utf-8') as f:
        my_list = json.load(f)
    return my_list

def build_data():
    with open(BASE_DIR + '/data/data.json',encoding='utf-8') as f:
        data: list = json.load(f)
        my_list = []
        for i in data:
            my_list.append(tuple(i.values()))
        return my_list

def build_data_add():
    with open(BASE_DIR + '/data/data_add.json',encoding='utf-8') as f:
        data = json.load(f)
        mylist = []
    for i in data:
        mylist.append(tuple(i.values()))
    return mylist
def build_data_add_teacher():
    with open(BASE_DIR + '/data/data_add_teacher.json',encoding='utf-8') as f:
        data = json.load(f)  # [[]] 不需要再转换

    return data

if __name__ == '__main__':
    print(read())
    print(build_data())
    print(build_data_add())
    print(build_data_add_teacher())

